/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pbl_cliente;

import java.io.DataOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Asuka
 */
public class TrataPingCliente implements Runnable{
    private String dadoPing;
    private OutputStream clienteout;
    public TrataPingCliente(OutputStream out, String dp){
        this.dadoPing = dp;
        this.clienteout = out;
    }
    public void run(){
        if(dadoPing.split(":")[0].equals("PING")){
            try {
                DataOutputStream esc = new DataOutputStream(clienteout);
                esc.writeUTF("PING:OK:");
            } catch (IOException ex) {
                Logger.getLogger(TrataPingCliente.class.getName()).log(Level.SEVERE, null, ex);
            }
            }
    }
}
